home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 02 / 1 / DISK0217.ZIP / NELIST.PAS < prev    next >
Pascal/Delphi Source File  |  1984-12-20  |  21KB  |  626 lines

  1. Program NELIST (input, Output);                                       {.CP32}
  2.    {Lists TURBO Pascal programs on EpsonFX-80 numbering lines & marking
  3.     reserved words, if requested.}
  4. Const
  5.    MaxLin: integer = 60;
  6. Type
  7.    TpFace   = (UndB,UndE,DblB,DblE,EmphB,EmphE,SmallB,SmallE,FF);
  8.    ByteLine = array[0..3] of byte;
  9.    Bytes    = Array[UndB..FF] of Byteline;
  10.    Fil      = File of ByteLine;
  11.    Str255   = string[255];
  12.    Str14    = string[14];
  13.    Str10    = string[10]; {Shd be large enough for longest reserved word}
  14.    months   = string[4];
  15.    Str3     = string[3];
  16.    ResArr   = array[1..100] of str10;   {If adapting to another Pascal, this}
  17.                            {type must be large enough for your ResWords File}
  18. Var
  19.    C:                 char;
  20.    F:                 text;
  21.    FileName:          Str14;
  22.    Opening,Closing:   str3;
  23.    DateLine:          string[25];
  24.    Number:            string[16];
  25.    Line:              str255;
  26.    Day,I,LineNumber,
  27.      PageLineNumber,
  28.      Page,Year,NRes:  integer;
  29.    Skip,Und,Emph,
  30.       NumberLines:    Boolean;
  31.    Reserv:            ResArr;
  32.    Inst:              Bytes;
  33.    T:                 TpFace;
  34.    Istring:           array[UndB..SmallE] of str3;
  35.  
  36. Procedure BlankLine(I: integer);                                       {.CP5}
  37. Begin
  38.    GotoXY(12,I);
  39.    Write('                                                         ')
  40. End; {BlankLine}
  41.  
  42. Procedure Blank(Top,Bot: integer);                                     {.CP6}
  43. Var
  44.    I:              integer;
  45. Begin
  46.    For I := Top to Bot do BlankLine(I)
  47. End; {Blank}
  48.  
  49. Procedure ByeBye;                                                     {.CP13}
  50. Begin
  51.    Blank(10,12); HighVideo;
  52.    If Skip then begin
  53.       GotoXY(32,10); write('That''s it, then.');
  54.    End {if Skip}
  55.    Else begin
  56.       GotoXY(28-(length(FileName) div 2),10);
  57.       write('Done.  ',FileName,' sent to printer.')
  58.    End; {else}
  59.    GotoXY(34,12); write('Signing Off.');
  60.    GotoXY(1,22); LowVideo
  61. End; {ByeBye}
  62.  
  63. Procedure Rectangle;                                                  {.CP20}
  64. Var
  65.    I: integer;
  66.    HorU,HorL: string[60];
  67. Begin
  68.    HorU := ''; HorL := '';
  69.    For I := 1 to 60 do HorU := Concat(HorU,Chr(220));
  70.    For I := 1 to 60 do HorL := Concat(HorL,Chr(223));
  71.    HighVideo;
  72.    GotoXY(33,4); write('LISTER PROGRAM');
  73.    LowVideo;
  74.    gotoxy(11,5); writeln(HorU);
  75.    For I := 6 to 19 do
  76.    Begin
  77.       GotoXY(11,I); Write(Chr(219));
  78.       GotoXY(70,I); Write(Chr(219));
  79.    End;
  80.    GotoXY(11,20); write(HorL); HighVideo;
  81.    GotoXY(28,21); writeln('Facit: R. N. Wisan   6/84'); LowVideo
  82. End; {Rectangle}
  83.  
  84. Procedure Menu;                                                       {.CP10}
  85.  
  86.    Procedure CapName;                 {Capitalize File Name}
  87.    Var
  88.       I: integer;
  89.    Begin
  90.       for I := 1 to length(FileName) do
  91.          If (Ord(FileName[I]) > 96) and (Ord(FileName[I]) < 123) then
  92.             Filename[I] := Chr(Ord(FileName[I])-32)
  93.    End; {CapName}
  94.  
  95.    Procedure timer; {Reads date & time from clock}                    {.CP15}
  96.    type
  97.       dt      =       record
  98.                          yyyy:    1980..1999;
  99.                          mo:      01..12;
  100.                          dd:      01..31;
  101.                          hh:      00..23;
  102.                          mm:      00..59;
  103.                          ss:      00..59;
  104.                          hhh:     00..99;
  105.                       end;
  106.    Var
  107.       DtRec:          dt;
  108.       DateString:     string[14];
  109.       TimeString:     string[8];
  110.  
  111.       procedure DateTime(var dtrec: dt);                              {.CP20}
  112.       var
  113.          regpack:        record
  114.                             ax,bx,cx,dx,bp,si,di,ds,es,flags: integer;
  115.                          end;
  116.       begin
  117.          with regpack do begin
  118.             ax := swap($2C);
  119.             intr ($21,regpack);
  120.             dtrec.hh := (hi(cx));
  121.             dtrec.mm := (lo(cx));
  122.             dtrec.ss := hi(dx);
  123.             dtrec.hhh := lo(dx);
  124.             ax := swap($2A);
  125.             intr ($21,regpack);
  126.             dtrec.yyyy := cx;
  127.             dtrec.mo := hi(dx);
  128.             dtrec.dd := lo(dx);
  129.          end; {with}
  130.       end; {DateTime}
  131.  
  132.       Procedure MakeDateString;                                       {.CP31}
  133.       Var
  134.          Temp:        string[20];
  135.          Month:       string[4];
  136.  
  137.          Procedure MakeMonthString;
  138.          Begin
  139.             Case dtrec.mo of
  140.                1: Month := 'Jan.';
  141.                2: Month := 'Feb.';
  142.                3: Month := 'Mar.';
  143.                4: Month := 'Apr.';
  144.                5: Month := 'May' ;
  145.                6: Month := 'June';
  146.                7: Month := 'July';
  147.                8: Month := 'Aug.';
  148.                9: Month := 'Sep.';
  149.               10: Month := 'Oct.';
  150.               11: Month := 'Nov.';
  151.               12: Month := 'Dec.'
  152.             End {case}
  153.          End;  {MakeMonthString}
  154.  
  155.       Begin {MakeDateString}
  156.          MakeMonthString;
  157.          DateString := Month;
  158.          Str(Dtrec.dd,Temp);
  159.          DateString := DateString + ' ' + Temp;
  160.          Str(Dtrec.yyyy,Temp);
  161.          DateString := DateString + ', ' + Temp;
  162.       End; {MakeDateString}
  163.  
  164.       Procedure MakeTimeString;                                       {.CP19}
  165.       Var
  166.          Temp :       string[20];
  167.          Merid:       string[3];
  168.       Begin
  169.          If Dtrec.hh>11 then begin
  170.             Merid := ' pm';
  171.             Dtrec.hh := Dtrec.hh - 12
  172.          End {if}
  173.          else Merid := ' am';
  174.          If Dtrec.hh = 0 then Dtrec.hh := 12;
  175.          Str(Dtrec.hh,TimeString);
  176.          if Dtrec.ss>30 then Dtrec.mm := Dtrec.mm + 1;
  177.          if Dtrec.mm<10 then
  178.             TimeString := TimeString + ':0'
  179.          else TimeString := TimeString + ':';
  180.          Str(Dtrec.mm,Temp);
  181.          TimeString := TimeString + Temp + Merid
  182.       End; {MakeTimeString}
  183.  
  184.    Begin {Timer}                                                       {.CP9}
  185.       DateTime(DtRec);
  186.       MakeDateString;
  187.       MakeTimeString;
  188.       DateLine := DateString + ' (' + TimeString + ')';
  189.       HighVideo;
  190.       GotoXY(40-(Length(DateLine) div 2),18); Write(DateLine);
  191.       LowVideo
  192.    End; {Timer}
  193.  
  194.    Procedure EnterName;                                               {.CP37}
  195.    Var
  196.       I: integer;
  197.       Ans: char;
  198.  
  199.       Procedure GetAns;
  200.       Begin
  201.          Repeat
  202.             BlankLine(12);
  203.             GotoXY(25,10); write('What File do you want to list?');
  204.             GotoXY(34,12); read(Filename);
  205.             Capname;
  206.             If FileName='NONE' then begin
  207.                Skip := TRUE;
  208.                Ans := 'Y'
  209.             End {if}
  210.             Else Skip := FALSE;
  211.             If not Skip then begin
  212.                If Pos('.',Filename)=0 then
  213.                   If Pos(':',Filename)=0 then
  214.                      If length(Filename)<9 then
  215.                         Filename := Concat(Filename,'.PAS')
  216.                      Else
  217.                         Filename :=
  218.                            Concat(Copy(Filename,1,8),'.',Copy(Filename,9,3))
  219.                   Else
  220.                      If length(Filename)<11 then
  221.                         Filename := Concat(Filename,'.PAS')
  222.                      Else Filename :=
  223.                         Concat(Copy(Filename,1,10),'.',Copy(Filename,11,3));
  224.                BlankLine(12);
  225.                GotoXY((33-length(Filename) div 2),12);
  226.                write('Listing: ',Filename,', OK? ');
  227.                Read(Trm,Ans);
  228.             End {if not Skip}
  229.          Until (Ans='Y') or (Ans='y')
  230.       End; {GetAns}
  231.  
  232.       Procedure CheckFileName;                                        {.CP18}
  233.       Begin
  234.          Assign(F,Filename);
  235.          {$I-} Reset(F) {$I+};
  236.          I := IOresult;
  237.          If I=2 then Begin
  238.             Blank(9,12);
  239.             GotoXY(33-(Length(Filename) div 2),9);
  240.             write(Filename,' does not exist');
  241.             EnterName
  242.          End {If error #1 (have to call it #2 --glitch?}
  243.          Else if I<>0 then Begin
  244.             Blank(9,12);
  245.             GotoXY(26,10);
  246.             write('HELP! HELP!  Error #',I,' - maybe');
  247.             Halt
  248.          End {Else if other error}
  249.       End; {CheckFileName}
  250.  
  251.    Begin {EnterName}                                                  {.CP10}
  252.       HighVideo;
  253.       GetAns;
  254.       If not Skip then begin
  255.          CheckFileName;
  256.          If FileName[2]=':' then Filename := Copy(FileName,3,14);
  257.          LowVideo;
  258.          Blank(9,12)
  259.       End {if not Skip}
  260.    End; {EnterName}
  261.  
  262.    Procedure Options;                                                 {.CP14}
  263.    Var
  264.       I,Row: integer;
  265.       Okay,FirstRound: Boolean;
  266.       Ans: string[2];
  267.       Yep: char;
  268.  
  269.       Procedure OptionsBillboard;
  270.       Begin
  271.          GotoXY(24,Row);   write('Options: L for Line Numbering');
  272.          GotoXY(24,Row+1); write('         U for Underline KeyWords');
  273.          GotoXY(24,Row+2); write('         E for Emphasize KeyWords');
  274.          GotoXY(37,Row+3); read(Trm,Ans);
  275.       End; {OptionsBillboard}
  276.  
  277.       Procedure ReadOptionsBill;                                      {.CP28}
  278.       Begin
  279.          If Pos(' ',Ans)=2 then Ans := Ans[1];
  280.          If (Pos(' ',Ans)=1) and (Length(Ans)>1) then Ans := Ans[2];
  281.          For I := 1 to Length(Ans) do if (Ans[I]>='a') and (Ans[I]<='z')
  282.             then Ans[I] := chr(ord(Ans[I])-32);
  283.          I := Length(Ans);
  284.          Case I of
  285.             0: Okay := True;
  286.             1: If (Ans='L') or (Ans='U') or (Ans='E') or (Ans=' ')
  287.                   then  Okay := True else Okay := False;
  288.             2: If (Pos('L',Ans)<>0) and
  289.                   ((Pos('U',Ans)<>0) or  (Pos('E',Ans)<>0))
  290.                   then Okay := True else Okay := False;
  291.          End; {Case}
  292.          If not Okay then Begin
  293.             Blank(8,Row+3);
  294.             FirstRound := False; Row := 12;
  295.             GotoXY(31,8); write('Say again, please:');
  296.             GotoXY(24,9); write('You can have L and either U or E');
  297.             If (Pos('U',Ans)<>0) and (Pos('E',Ans)<>0) then Begin
  298.                GotoXY(25,10); write('(You can''t have BOTH U and E)')
  299.             End  {if}
  300.             Else Begin
  301.                GotoXY(23,10); write('(or enter a blank & have it plain)')
  302.             End {else}
  303.          End {if not}
  304.       End; {ReadOptionsBill}
  305.  
  306.       Procedure CheckOptions;                                         {.CP23}
  307.       Begin
  308.          If Pos('L',Ans)<>0 then NumberLines := True
  309.             else Numberlines := False;
  310.          If Pos('U',Ans)<>0 then Und := True else Und := False;
  311.          If Pos('E',Ans)<>0 then Emph := True else Emph := False;
  312.          If FirstRound then Blank(10,13) else Blank(8,Row+3);
  313.          GotoXY(24,10); Write('You want to ');
  314.          GotoXY(29,11);
  315.          If Und then write('A  Underline key words.')
  316.             else if Emph then write('A  Emphasize key words.')
  317.             else write('A  Leave the key words plain.');
  318.          GotoXY(29,12); write('B  ');
  319.          If NumberLines then writeln('Number the lines.')
  320.             else write ('Leave the lines unnumbered.');
  321.          GotoXY(24,14); write('Is that correct? ');
  322.          Read(trm,Yep);
  323.          BlankLine(14);
  324.          If not (Yep in ['Y','y']) then Begin
  325.             FirstRound := True;
  326.             Options;
  327.          End; {if}
  328.       End; {CheckOptions}
  329.  
  330.    Begin {Options}                                                    {.CP11}
  331.       HighVideo;
  332.       FirstRound := True;
  333.       Row := 10;
  334.       Repeat
  335.          OptionsBillboard;
  336.          ReadOptionsBill
  337.       until Okay;
  338.       CheckOptions;
  339.       LowVideo
  340.    End; {Options}
  341.  
  342. Begin  {Menu}                                                         {.CP11}
  343.    Timer;
  344.    Entername;
  345.    If not skip then begin
  346.       Blank(10,12);
  347.       Options;
  348.    End; {if not Skip}
  349.    LowVideo
  350. End;  {Menu}
  351.  
  352. Procedure PrintHeader;             {Print header line}                {.CP18}
  353. Var
  354.    Headline, Opener: string[80];
  355. Begin
  356.    Writeln(Lst,' ');
  357.    If Numberlines then write(Lst,Istring[SmallE]);          {Set normal Pica}
  358.    If Page = 1 then Headline := DateLine
  359.    else
  360.    Begin
  361.       Str(Page,Headline);
  362.       Headline := Concat('Page ',Headline);
  363.    End; {else}
  364.    Opener := Concat('File: ',FileName);
  365.    writeln(Lst,Opener, Headline:80-length(opener));
  366.    IF NumberLines then write(Lst,Istring[SmallB]);    {Set elite}
  367.    writeln(Lst);
  368.    Page := Page + 1;
  369. End; {PrintHeader}
  370.  
  371. Procedure PrintControl(var PageLineNumber: integer);                  {.CP20}
  372. Var
  373.    Sym: string[8];
  374.    S: array[1..8] of char;
  375.    Col, I, J, Err: integer;
  376. Begin
  377.    IF pos(Concat('{.','PA}'),Line)<>0 then PageLineNumber :=MaxLin;
  378.    IF pos(Concat('{.','CP'),Line) <>0 then
  379.    Begin
  380.       I := pos(Concat('{.','CP'),Line) + 4; Col := 1;
  381.       For J := 1 to 8 do S[J] := Chr(0);
  382.       Repeat
  383.          S[Col] := Line[I];
  384.          Col := Col + 1; I := I + 1;
  385.        Until Line[I] = '}';
  386.        Sym := S;
  387.        Val(sym,I,Err);
  388.        IF PageLineNumber > (MaxLin-I) then PageLineNumber := MaxLin;
  389.     End {if}
  390. End; {PrintControl}
  391.  
  392. Procedure CantCont(FilNam: Str14);                                     {.CP9}
  393. Begin
  394.    Blank(10,12); HighVideo;
  395.    GotoXY(27,10); write('     Can''t continue      ');
  396.    GotoXY(27,12); write('Error reading ',FilNam);
  397.    GotoXY(27,13); write('Is it on the default disk?');
  398.    LowVideo; GotoXY(1,23);
  399.    Halt
  400. End; {CantCnt}
  401.  
  402. Procedure GetTypeStyle;                                               {.CP12}
  403. Var
  404.    F:              Fil;
  405. Begin
  406.    Assign(F,'NEPRN.DAT');
  407.    {$I-} Reset(F) {$I+};
  408.    If IOresult=0 then Begin
  409.       For T := UndB to FF do If not Eof(F) then read(F,Inst[T]);
  410.       Close(F);
  411.    End {If no error}
  412.    Else CantCont('NEPRN.DAT')
  413. End; {GetTypeStyle}
  414.  
  415. Procedure SetStyle;                                                   {.CP25}
  416. Var
  417.    I:              integer;
  418.    T:              TpFace;
  419. Begin
  420.    For T := UndB to SmallE do Begin
  421.       Istring[T] := '';
  422.       For I := 1 to Inst[T,0] do Istring[T] := Istring[T] + Chr(Inst[T,I])
  423.    End; {For T}
  424.    If Und then Begin
  425.       Opening := Istring[UndB];                    {Start underlining}
  426.       Closing := Istring[UndE]                     {Stop underlining}
  427.    end; {if Und}
  428.    If Emph then Begin
  429.       If NumberLines then Begin
  430.          Opening := Istring[DblB];                 {Start double strike}
  431.          Closing := Istring[DblE]                  {Stop double strike}
  432.       end {if}
  433.       else Begin
  434.          Opening := Istring[EmphB];                {Start "Emphasized" type}
  435.          Closing := Istring[EmphE]                 {Stop "Emphasized" type}
  436.       end {else}
  437.    End; {If Emph}
  438.    If NumberLines then write(Lst,Istring[SmallE])  {Set elite mode}
  439. End; {SetStyle}
  440.  
  441. Procedure LoadReserv(Var Reserv: ResArr);  {Load reserved words file} {.CP21}
  442.   {If you're adapting this to a Pascal other than TURBO 1.00, make your own}
  443.   {list of reserved words in file, RESWORDS.TXT, make sure Type str10 is as
  444.   {long as your longest reserved word and Type ResArr has room enough.}
  445. Var
  446.    Fil: text;
  447.    I: integer;
  448. Begin
  449.    Assign(Fil,'RESWORDS.TXT');
  450.    {$I-} Reset(Fil) {$I+};
  451.    If IOresult=0 then Begin
  452.       I := 0;
  453.       While not Eof(Fil) do begin
  454.          I := I + 1;
  455.          Readln(Fil,Reserv[I]);
  456.       End; {while}
  457.       Close(Fil);
  458.       NRes := I
  459.    End {if no error}
  460.    Else CantCont('RESWORDS.TXT')
  461. End; {LoadReserve}
  462.  
  463. Procedure ReadingMatter;                                               {.CP9}
  464. Begin
  465.    Blank(9,13);
  466.    HighVideo;
  467.    GotoXY(30-(Length(FileName) div 2),12); write('Sending ');
  468.    TextColor(31);
  469.    write(FileName);
  470.    TextColor(15);
  471.    Write(' to printer.');
  472.    LowVideo
  473. End; {ReadingMatter}
  474.  
  475. Procedure ListIt;                                                     {.CP20}
  476. var
  477.    Pager:          integer;
  478.    Quote,DblComm,
  479.       Comm:        boolean;
  480.  
  481.    Procedure Underline (var Line: str255);
  482.    Var
  483.       I,J: integer;
  484.       Lc,Object: str255;
  485.       Und,Emph,NumberLines: Boolean;
  486.  
  487.       Procedure LowCase(var S: str255);            {Convert S to lower case}
  488.       Const
  489.          Change: set of char = ['A'..'Z'];
  490.       Var
  491.          I:           byte;
  492.       Begin
  493.          for I := 1 to length(S) do
  494.             if S[I] in Change then S[I] := Chr(ord(S[I]) or 32)
  495.       end; {LowCase}
  496.  
  497.       Procedure Ins (var Obj:str10; var Line,Lc:str255; Op,Cl:Str3);  {.CP38}
  498.       Const
  499.          Markers: set of char =  [' ','.',';','['];
  500.       var
  501.          LcTemp,Temp:        str255;
  502.          Posit,Len,Fin:     integer;
  503.          Fore, Aft:          boolean;
  504.          Pre, Post:          char;
  505.       begin
  506.          Temp := ''; LcTemp := '';
  507.          Len := Length(Obj);
  508.          While Pos(Obj,Lc)<>0 do begin
  509.             Pre := 'z'; Post := 'z';
  510.             Posit := Pos(Obj,Lc); Fin := Posit+Len-1;
  511.             If Posit=1 then Pre := ' '                    {beginning of Lc}
  512.                else Pre := Lc[Posit-1];
  513.             If Fin = Length(Lc) then Post := ' '          {end of Lc}
  514.                else Post := Lc[Fin+1];
  515.             If Post in Markers then Aft := True
  516.                else Aft := False;
  517.             If (Pre=' ') then Fore := True
  518.                else Fore := False;
  519.             If Fore and Aft then begin
  520.                If Posit>1 then begin
  521.                   Temp := Concat(Temp,Copy(Line,1,Posit-1));
  522.                   LcTemp := Concat(LcTemp,Copy(Lc,1,Posit-1))
  523.                End; {if Posit>1}
  524.                Temp := Concat(Temp,Op,Copy(Line,Posit,Len),Cl);
  525.                LcTemp := Concat(LcTemp,Op,Copy(Lc,Posit,Len),Cl)
  526.             end {if Fore & Aft}
  527.             else begin
  528.                Temp := Concat(Temp,Copy(Line,1,Fin));
  529.                LcTemp := Concat(LcTemp,Copy(Lc,1,Fin))
  530.             end; {else}
  531.             Delete(Lc,1,Fin); Delete(Line,1,Fin)
  532.          End; {While}
  533.          Lc := Concat(LcTemp,Lc);
  534.          Temp := Concat(Temp,Line);
  535.          Line := Temp
  536.       End; {Procedure Ins}
  537.  
  538.       Function Comb(Line: str255): str255;                            {.CP11}
  539.       Var
  540.          I,J: integer;
  541.  
  542.          Procedure CkComm;
  543.          Begin
  544.             if Line[I]='{' then Comm := True;
  545.             If (Line[I]='(') and (Line[I+1]='*') then DblComm := True;
  546.             If Line[I]='}' then Comm := False;
  547.             If (Line[I]='*') and (Line[I+1]=')') then DblComm := False
  548.          End; {CkComm}
  549.  
  550.       Begin {Comb}                                                    {.CP12}
  551.          For I := 1 to length(Line) do begin
  552.             if (Line[I]=chr(39)) and not(Comm or DblComm) then
  553.                Quote := not Quote;
  554.             If not Quote then CkComm;
  555.             If (Line[I]=Opening[1]) and (Quote or Comm or DblComm) then begin
  556.                delete(Line,I,length(Opening));
  557.                Insert(closing,Line,I)
  558.             end {if}
  559.          End; {For I}
  560.          Comb := Line
  561.       End; {Comb}
  562.  
  563.    Begin {Underline}                                                   {.CP7}
  564.       Lc := Line;
  565.       LowCase(Lc);
  566.       For I := 1 to NRes do Ins(Reserv[I],Line,Lc,Opening,Closing);
  567.       If ((Pos(Chr(39),Line) + Pos('{',Line) + Pos('(*',Line))<>0)
  568.          or Quote or Comm or DblComm then Line := Comb(Line);
  569.    End; {Underline}
  570.  
  571.    Procedure PrintLine;               {Print one line}                {.CP13}
  572.    Begin
  573.       If Line<>'' then
  574.       Begin
  575.          If (NumberLines) then begin
  576.             Str(LineNumber,Number);
  577.             write(Lst,Number:5,' ':9)
  578.          End; {If Numberlines}
  579.          If Und or Emph then Underline(Line)
  580.       End; {If Line is not blank}
  581.       writeln(Lst,Line);
  582.       LineNumber := LineNumber + 1
  583.    End; {PrintLine}
  584.  
  585.    Procedure NewPage;                                                  {.CP7}
  586.    Var
  587.       K:           integer;
  588.    Begin
  589.       If Inst[FF,1]=12 then write(Lst,Char(12))
  590.       Else For K := Pager to Inst[FF,1] do writeln(Lst,' ')
  591.    End; {NewPage}
  592.  
  593. Begin {ListIt}                                                        {.CP19}
  594.    LineNumber := 1; PageLineNumber := 3; Page := 1;
  595.    Quote := False; Comm := False; DblComm := False;
  596.    PrintHeader;
  597.    While not EOF(F) do Begin
  598.       Readln(F,Line);
  599.       PageLineNumber := PageLineNumber + 1;
  600.       Pager := PageLineNumber;
  601.       If pos('{.',Line)<>0 then PrintControl(PageLineNumber);
  602.       If (PageLineNumber >= MaxLin) then Begin
  603.          NewPage;
  604.          PrintHeader;
  605.          PageLineNumber := 4;
  606.       End; {If (PageLine}
  607.       PrintLine;
  608.    End; {While}
  609.    If Numberlines then write(Lst,Istring[SmallE]);   {Printer back to normal}
  610.    Pager := PageLineNumber + 1;
  611.    NewPage
  612. End; {ListIt}
  613.  
  614. Begin {Main}                                                          {.CP13}
  615.    ClrScr;
  616.    Rectangle;
  617.    GetTypeStyle;
  618.    LoadReserv(Reserv);
  619.    Menu;
  620.    If not Skip then begin
  621.       If Und or Emph or NumberLines then SetStyle;
  622.       ReadingMatter;
  623.       ListIt;
  624.    End; {if not Skip}
  625.    ByeBye;
  626. End. {Main}